home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD World 1998 January
/
CD World - Ocak 1998.iso
/
misc
/
dbase55
/
disk7
/
samples1.pak
/
COUNTRY.WFM
< prev
next >
Wrap
Text File
|
1995-07-18
|
16KB
|
520 lines
************************************************************************************
* PROGRAM: Country.wfm
*
* WRITTEN BY: Borland Samples Group
*
* DATE: 2/95
*
* UPDATED: 7.95
*
* REVISION: $Revision: 1.8 $
*
* VERSION: Visual dBASE
*
* DESCRIPTION: This is a program that shows information about various
* european countries as you click on the appropriate country
* on the image of the map of Europe. The program shows
* the ability to use "hot" maps in Visual dBASE, and
* also illustrates the various uses and types of arrays
* you can create in your programs.
*
* PARAMETERS: None
*
* CALLS: Buttons.cc (Custom Controls file)
*
* USAGE: Do Country.wfm
*******************************************************************************
#define MAX_COUNTRIES 7
#define GERMANY_RECTS 32
#define FRANCE_RECTS 24
#define ITALY_RECTS 30
#define SPAIN_RECTS 18
#define UK_RECTS 14
#define PORTUGAL_RECTS 7
#define IRELAND_RECTS 7
create session
set talk off
** END HEADER -- do not remove this line*
* Generated on 07/11/95
*
parameter bModal
local f
f = new COUNTRYFORM()
if (bModal)
f.mdi = .F. && ensure not MDI
f.ReadModal()
else
f.Open()
endif
CLASS COUNTRYFORM OF FORM
Set Procedure To &_dbwinhome.samples\BUTTONS.CC additive
this.OnOpen = CLASS::FORM_ONOPEN
this.Width = 67.166
this.OnClose = CLASS::FORM_ONCLOSE
this.View = "country.dbf"
this.Text = "Country Information"
this.Top = 2
this.Left = 6.833
this.ColorNormal = "N/GB"
this.Height = 16
DEFINE RECTANGLE ALLINFORECT OF THIS;
PROPERTY;
Width 65.165,;
Text "",;
Top 0.1973,;
Left 1,;
ColorNormal "gb/gb",;
Height 13.5
DEFINE RECTANGLE IMAGERECT OF THIS;
PROPERTY;
Width 44.6348,;
Text "Rectangle2",;
Top 0.7051,;
Left 2.1973,;
ColorNormal "w/w",;
PatternStyle 5,;
BorderStyle 1,;
Height 12.5293
DEFINE IMAGE MAPIMAGE OF THIS;
PROPERTY;
DataSource "BINARY COUNTRY->MAP",;
Width 42.665,;
Alignment 1,;
OnLeftMouseDown CLASS::MAPIMAGE_ONLEFTMOUSEDOWN,;
Top 1,;
Left 3,;
Height 11.8994
DEFINE TEXT CAPITALTEXT OF THIS;
PROPERTY;
FontName "Arial",;
Width 15.002,;
Text "Capital:",;
Top 3.5625,;
Left 48.6641,;
ColorNormal "b/gb",;
FontSize 9,;
Height 0.8486
DEFINE ENTRYFIELD CAPITALENTRY OF THIS;
PROPERTY;
FontName "Arial",;
Function "B",;
Width 15,;
FontItalic .T.,;
Top 4.3975,;
ColorNormal "gr+/gb",;
Enabled .F.,;
DataLink "COUNTRY->CAPITAL",;
Left 50.5,;
Border .F.,;
FontSize 10,;
Height 0.8516
DEFINE TEXT SIZETEXT OF THIS;
PROPERTY;
FontName "Arial",;
Width 15.002,;
Text "Population:",;
Top 5.5625,;
Left 48.6641,;
ColorNormal "b/gb",;
FontSize 9,;
Height 0.8486
DEFINE ENTRYFIELD POPULATIONENTRY OF THIS;
PROPERTY;
FontName "Arial",;
Function "B",;
Width 11.5,;
FontItalic .T.,;
Picture "99.99",;
Top 6.5,;
Enabled .F.,;
DataLink "COUNTRY->POPULATION",;
Left 50.5,;
ColorNormal "RG+/gb",;
Border .F.,;
FontSize 9,;
Height 0.9111
DEFINE TEXT POPULATIONTEXT OF THIS;
PROPERTY;
FontName "Arial",;
Width 15.002,;
Text "Size:",;
Top 7.5625,;
Left 48.6641,;
ColorNormal "b/gb",;
FontSize 9,;
Height 0.8486
DEFINE ENTRYFIELD SIZEENTRY OF THIS;
PROPERTY;
FontName "Arial",;
Function "B",;
Width 11.5,;
FontItalic .T.,;
Picture "999,999,999",;
Top 8.5,;
Enabled .F.,;
DataLink "COUNTRY->size",;
Left 50.5,;
ColorNormal "RG+/gb",;
Border .F.,;
FontSize 9,;
Height 0.9111
DEFINE TEXT GNPTEXT OF THIS;
PROPERTY;
FontName "Arial",;
Width 15.002,;
Text "GNP:",;
Top 9.5625,;
Left 48.6641,;
ColorNormal "b/gb",;
FontSize 9,;
Height 0.8486
DEFINE ENTRYFIELD GNPENTRY OF THIS;
PROPERTY;
FontName "Arial",;
Width 11.5,;
FontItalic .T.,;
Picture "999,999.99",;
Function "$B",;
Top 10.5,;
Enabled .F.,;
DataLink "COUNTRY->gnp",;
Left 50.5,;
ColorNormal "gr+/gb",;
Border .F.,;
FontSize 9,;
Height 0.9111
DEFINE CLOSEBUTTON CLOSEBUTTON1 OF THIS;
PROPERTY;
ColorNormal "b/gb",;
Width 14.165,;
Group .T.,;
StatusMessage "Click on a country on the map to see information about it.",;
Top 14.0996,;
Left 26.5,;
Height 1.5469
DEFINE SAMPLEINFOBUTTON COUNTRYINFOBUTTON OF THIS;
PROPERTY;
Width 3.5,;
Group .T.,;
Top 0.3975,;
Left 62.5,;
Height 1.1641
DEFINE TEXT POPMILLIONTEXT OF THIS;
PROPERTY;
FontName "Arial",;
Width 5,;
Alignment 5,;
Text "M",;
Top 6.5,;
Left 60,;
ColorNormal "gr+/gb",;
FontSize 9,;
Height 0.9111
DEFINE TEXT GNPBILLIONTEXT OF THIS;
PROPERTY;
FontName "Arial",;
Width 5,;
Alignment 5,;
Text "B",;
Top 10.5,;
Left 60,;
ColorNormal "gr+/gb",;
FontSize 9,;
Height 0.9111
DEFINE TEXT TEXT1 OF THIS;
PROPERTY;
FontName "Arial",;
Width 5,;
Alignment 5,;
Text "Sq K",;
Top 8.5,;
Left 60,;
ColorNormal "gr+/gb",;
FontSize 9,;
Height 0.9111
Procedure Form_OnOpen
****************************************************************************
* Create rectangle arrys for different countries
form.GermanyAr = new array(GERMANY_RECTS)
form.FranceAr = new array(FRANCE_RECTS)
form.SpainAr = new array(SPAIN_RECTS)
form.ItalyAr = new array(ITALY_RECTS)
form.UKAr = new array(UK_RECTS)
form.PortugalAr = new array(PORTUGAL_RECTS)
form.IrelandAr = new array(IRELAND_RECTS)
form.CountryAr = new array(MAX_COUNTRIES)
form.CountryAr[1] = {GERMANY_RECTS, form.GermanyAr}
form.CountryAr[2] = {FRANCE_RECTS, form.FranceAr}
form.CountryAr[3] = {ITALY_RECTS, form.ItalyAr}
form.CountryAr[4] = {SPAIN_RECTS, form.SpainAr}
form.CountryAr[5] = {UK_RECTS, form.UKAr}
form.CountryAr[6] = {PORTUGAL_RECTS, form.PortugalAr}
form.CountryAr[7] = {IRELAND_RECTS, form.IrelandAr}
CLASS::FillCoordArrays()
form.countryInfoButton.sampleName = "Country.wfm"
****************************************************************************
Procedure Form_OnClose
****************************************************************************
close procedure &_dbwinhome.samples\Buttons.cc
****************************************************************************
Procedure MAPIMAGE_OnLeftMouseDown(flags, col, row)
* Highlight the country that was clicked on.
****************************************************************************
local i, in, checkFunction
i = 1
in = .F.
do while .not. in .and. i <= MAX_COUNTRIES
in = CLASS::CheckCountry(col, row, form.countryAr[i][1], ;
form.countryAr[i][2], i)
i = i + 1
enddo
****************************************************************************
Function CheckCountry(col, row, max, rectAr, recNo)
* Check if point clicked is in the parameter country array (rectAr)
****************************************************************************
private pointIn, i
i = 1
pointIn = .F.
do while .not. pointIn .and. i <= max
if (col >= rectAr[i][1] .and. col <= rectAr[i][3]);
.and. (row >= rectAr[i][2] .and. row <= rectAr[i][4])
pointIn = .T.
go recNo
endif
i = i + 1
enddo
return pointIn
****************************************************************************
Procedure FillCoordArrays
* Assign coordinates to arrays for various countries.
****************************************************************************
form.GermanyAr[1] = {23.67, 3.06, 26.17, 3.31}
form.GermanyAr[2] = {23.50, 3.31, 26.00, 3.44}
form.GermanyAr[3] = {26.17, 3.25, 29.67, 4.31}
form.GermanyAr[4] = {27.50, 4.38, 29.50, 4.56}
form.GermanyAr[5] = {29.67, 4.25, 30.50, 4.38}
form.GermanyAr[6] = {28.83, 3.13, 30.17, 4.06}
form.GermanyAr[7] = {22.17, 3.44, 23.33, 3.56}
form.GermanyAr[8] = {21.67, 3.69, 23.50, 3.75}
form.GermanyAr[9] = {21.83, 3.50, 23.67, 3.63}
form.GermanyAr[10] = {21.17, 3.69, 23.83, 3.81}
form.GermanyAr[11] = {21.67, 3.94, 23.67, 4.13}
form.GermanyAr[12] = {20.17, 4.00, 20.83, 4.19}
form.GermanyAr[13] = {20.50, 4.31, 23.17, 4.50}
form.GermanyAr[14] = {20.83, 4.50, 30.00, 4.31}
form.GermanyAr[15] = {30.17, 4.25, 30.83, 4.25}
form.GermanyAr[16] = {21.00, 4.88, 29.33, 4.38}
form.GermanyAr[17] = {21.00, 5.06, 27.67, 4.69}
form.GermanyAr[18] = {21.00, 5.13, 27.33, 4.88}
form.GermanyAr[19] = {23.00, 5.31, 27.33, 5.44}
form.GermanyAr[20] = {27.33, 5.13, 28.50, 5.56}
form.GermanyAr[21] = {28.17, 5.25, 29.50, 5.50}
form.GermanyAr[22] = {22.83, 5.50, 28.67, 5.63}
form.GermanyAr[23] = {22.33, 5.75, 28.00, 5.88}
form.GermanyAr[24] = {20.67, 4.56, 29.50, 4.50}
form.GermanyAr[25] = {23.17, 4.25, 27.33, 5.00}
form.GermanyAr[26] = {21.00, 5.13, 27.67, 5.13}
form.GermanyAr[27] = {23.00, 5.06, 28.17, 5.88}
form.GermanyAr[28] = {20.33, 4.25, 23.17, 5.19}
form.GermanyAr[29] = {22.50, 4.00, 25.67, 5.06}
form.GermanyAr[30] = {24.83, 3.50, 29.83, 4.38}
form.GermanyAr[31] = {26.17, 3.13, 30.17, 4.31}
form.GermanyAr[32] = {22.17, 3.56, 30.00, 4.13}
form.FranceAr[1] = {11.67, 5.24, 21.50, 7.24}
form.FranceAr[2] = {13.67, 4.76, 19.00, 4.76}
form.FranceAr[3] = {14.67, 4.65, 19.83, 4.76}
form.FranceAr[4] = {11.17, 4.76, 13.00, 4.88}
form.FranceAr[5] = {11.33, 5.06, 14.33, 5.06}
form.FranceAr[6] = {8.17, 5.35, 10.50, 5.65}
form.FranceAr[7] = {8.33, 5.53, 12.00, 5.71}
form.FranceAr[8] = {11.00, 5.71, 21.50, 5.71}
form.FranceAr[9] = {18.17, 4.59, 21.83, 5.59}
form.FranceAr[10] = {20.67, 5.00, 22.33, 5.24}
form.FranceAr[11] = {22.33, 5.06, 22.67, 5.18}
form.FranceAr[12] = {12.33, 6.24, 20.50, 6.29}
form.FranceAr[13] = {20.33, 5.76, 20.67, 5.94}
form.FranceAr[14] = {12.50, 6.82, 21.33, 6.47}
form.FranceAr[15] = {12.17, 7.18, 21.83, 7.18}
form.FranceAr[16] = {11.50, 7.41, 17.00, 7.82}
form.FranceAr[17] = {15.50, 7.00, 20.00, 7.24}
form.FranceAr[18] = {23.33, 7.59, 24.33, 8.24}
form.FranceAr[19] = {15.50, 4.29, 18.17, 4.47}
form.FranceAr[20] = {23.33, 8.13, 24.33, 8.63}
form.FranceAr[21] = {12.83, 6.88, 21.50, 7.63}
form.FranceAr[22] = {15.67, 4.44, 17.33, 4.94}
form.FranceAr[23] = {17.50, 4.75, 18.67, 5.19}
form.FranceAr[24] = {14.00, 5.06, 20.83, 6.38}
form.ItalyAr[1] = {21.33, 6.35, 29.33, 6.65}
form.ItalyAr[2] = {25.33, 6.00, 28.67, 6.24}
form.ItalyAr[3] = {21.50, 6.29, 29.33, 6.24}
form.ItalyAr[4] = {21.17, 6.65, 23.50, 7.06}
form.ItalyAr[5] = {23.50, 6.94, 27.67, 6.94}
form.ItalyAr[6] = {25.50, 7.29, 28.67, 7.35}
form.ItalyAr[7] = {25.67, 7.41, 29.67, 7.71}
form.ItalyAr[8] = {26.00, 7.71, 29.50, 7.71}
form.ItalyAr[9] = {27.67, 8.12, 31.00, 8.12}
form.ItalyAr[10] = {28.83, 8.35, 32.67, 8.29}
form.ItalyAr[11] = {30.33, 8.53, 34.33, 8.59}
form.ItalyAr[12] = {31.50, 8.94, 33.17, 9.18}
form.ItalyAr[13] = {31.67, 9.65, 32.33, 9.59}
form.ItalyAr[14] = {32.67, 8.47, 35.00, 8.88}
form.ItalyAr[15] = {27.83, 9.76, 31.33, 10.18}
form.ItalyAr[16] = {23.33, 8.24, 24.83, 9.24}
form.ItalyAr[17] = {21.67, 6.88, 25.17, 7.12}
form.ItalyAr[18] = {23.50, 6.65, 28.00, 7.06}
form.ItalyAr[19] = {24.50, 7.00, 29.17, 7.47}
form.ItalyAr[20] = {26.17, 7.71, 30.17, 7.94}
form.ItalyAr[21] = {27.83, 8.06, 31.67, 8.12}
form.ItalyAr[22] = {28.67, 8.29, 33.33, 8.41}
form.ItalyAr[23] = {31.50, 9.35, 32.67, 9.65}
form.ItalyAr[24] = {23.00, 8.81, 24.33, 9.81}
form.ItalyAr[25] = {28.17, 10.19, 31.33, 10.63}
form.ItalyAr[26] = {25.83, 7.94, 30.00, 8.31}
form.ItalyAr[27] = {27.50, 8.44, 30.83, 8.50}
form.ItalyAr[28] = {29.67, 8.88, 33.17, 9.06}
form.ItalyAr[29] = {31.67, 9.31, 32.33, 10.19}
form.ItalyAr[30] = {32.67, 8.94, 34.33, 9.19}
form.SpainAr[1] = {3.00, 7.59, 12.50, 7.59}
form.SpainAr[2] = {2.67, 7.41, 17.00, 8.18}
form.SpainAr[3] = {4.67, 7.94, 6.50, 8.06}
form.SpainAr[4] = {5.50, 8.06, 13.67, 9.35}
form.SpainAr[5] = {5.17, 9.00, 12.67, 10.06}
form.SpainAr[6] = {15.17, 9.35, 15.67, 9.29}
form.SpainAr[7] = {16.67, 9.00, 17.33, 9.18}
form.SpainAr[8] = {17.50, 8.82, 18.17, 8.94}
form.SpainAr[9] = {12.33, 7.06, 17.17, 17.53}
form.SpainAr[10] = {17.50, 7.06, 21.50, 7.16}
form.SpainAr[11] = {20.00, 7.24, 22.00, 7.29}
form.SpainAr[12] = {13.83, 4.70, 18.17, 4.76}
form.SpainAr[13] = {11.33, 4.94, 19.67, 5.12}
form.SpainAr[14] = {6.00, 9.25, 12.67, 10.38}
form.SpainAr[15] = {5.33, 10.13, 10.83, 10.69}
form.SpainAr[16] = {6.00, 10.63, 7.83, 11.06}
form.SpainAr[17] = {8.50, 10.75, 11.17, 10.81}
form.SpainAr[18] = {3.17, 8.00, 7.67, 8.50}
form.UKAr[1] = {8.17, 1.13, 7.67, 4.88}
form.UKAr[2] = {7.83, 1.19, 12.67, 4.50}
form.UKAr[3] = {12.00, 2.88, 14.50, 4.38}
form.UKAr[4] = {13.33, 3.06, 14.50, 4.06}
form.UKAr[5] = {14.00, 3.75, 15.00, 4.06}
form.UKAr[6] = {5.67, 1.19, 6.17, 1.31}
form.UKAr[7] = {6.00, 1.50, 6.83, 1.81}
form.UKAr[8] = {6.17, 1.81, 7.83, 2.13}
form.UKAr[9] = {7.00, 1.25, 9.67, 4.63}
form.UKAr[10] = {7.67, 1.38, 11.33, 4.50}
form.UKAr[11] = {11.83, 0.13, 12.33, 0.38}
form.UKAr[12] = {5.00, 2.50, 7.00, 3.00}
form.UKAr[13] = {4.17, 2.88, 5.17, 3.00}
form.UKAr[14] = {6.17, 2.94, 7.00, 3.00}
form.PortugalAr[1] = {3.50, 8.06, 5.67, 9.94}
form.PortugalAr[2] = {2.67, 8.94, 3.17, 9.35}
form.PortugalAr[3] = {3.67, 8.69, 4.67, 10.56}
form.PortugalAr[4] = {5.17, 8.63, 5.67, 9.50}
form.PortugalAr[5] = {5.00, 8.63, 6.17, 8.88}
form.PortugalAr[6] = {2.83, 9.31, 3.50, 9.94}
form.PortugalAr[7] = {3.50, 9.94, 4.67, 10.69}
form.IrelandAr[1] = {2.50, 3.00, 6.00, 3.94}
form.IrelandAr[2] = {2.17, 3.38, 3.67, 3.56}
form.IrelandAr[3] = {2.83, 3.69, 4.17, 3.69}
form.IrelandAr[4] = {1.83, 3.88, 3.33, 4.19}
form.IrelandAr[5] = {3.33, 3.81, 5.83, 4.06}
form.IrelandAr[6] = {3.83, 2.63, 4.50, 2.75}
form.IrelandAr[7] = {3.67, 2.69, 4.00, 2.88}
Procedure PUSHBUTTON1_OnClick
local notesForm
notesForm = new CountryNotesForm()
notesForm.mdi = .F.
notesForm.ReadModal()
notesForm.Release()
ENDCLASS